/***********************************************
/gen auto by zuitools
***********************************************/
#ifndef __MODESETACTIVITY_H__
#define __MODESETACTIVITY_H__


#include "app/Activity.h"
#include "entry/EasyUIContext.h"

#include "uart/ProtocolData.h"
#include "uart/ProtocolParser.h"

#include "utils/Log.h"
#include "control/ZKDigitalClock.h"
#include "control/ZKButton.h"
#include "control/ZKCircleBar.h"
#include "control/ZKDiagram.h"
#include "control/ZKListView.h"
#include "control/ZKPointer.h"
#include "control/ZKQRCode.h"
#include "control/ZKTextView.h"
#include "control/ZKSeekBar.h"
#include "control/ZKEditText.h"
#include "control/ZKVideoView.h"
#include "window/ZKSlideWindow.h"

/*TAG:Macro宏ID*/
#define ID_MODESET_TextLogo    50011
#define ID_MODESET_Bottombg    50023
#define ID_MODESET_Speed    50047
#define ID_MODESET_speedUnit    50048
#define ID_MODESET_option_bg    50002
#define ID_MODESET_menu_iconbg    50001
#define ID_MODESET_TextView2    50003
#define ID_MODESET_TextVersion    50022
#define ID_MODESET_WindowVersion    110010
#define ID_MODESET_WindowCapacityTank    110009
#define ID_MODESET_Windowlanguage    110008
#define ID_MODESET_TextLuminance_value    50021
#define ID_MODESET_SeekBarLuminance    91001
#define ID_MODESET_TextView1    50020
#define ID_MODESET_WindowLuminance    110007
#define ID_MODESET_WindowUnit    110006
#define ID_MODESET_Textmenu_icon5    50019
#define ID_MODESET_Textmenu_icon4    50018
#define ID_MODESET_Textmenu_icon3    50017
#define ID_MODESET_Textmenu_icon2    50016
#define ID_MODESET_Textmenu_icon1    50015
#define ID_MODESET_Windowmenu    110004
#define ID_MODESET_CircleBarEngine_oil    130002
#define ID_MODESET_TextEngine_oil    50005
#define ID_MODESET_PointerSpeed    90002
#define ID_MODESET_WindowSpeed    110003
#define ID_MODESET_TextBattery_icon    50004
#define ID_MODESET_CircleBarBattery    130001
#define ID_MODESET_PointerRpm    90001
#define ID_MODESET_WindowRpm    110002
#define ID_MODESET_Windowmain    110001
/*TAG:Macro宏ID END*/

class modeSetActivity : public Activity, 
                     public ZKSeekBar::ISeekBarChangeListener, 
                     public ZKListView::IItemClickListener,
                     public ZKListView::AbsListAdapter,
                     public ZKSlideWindow::ISlideItemClickListener,
                     public EasyUIContext::ITouchListener,
                     public ZKEditText::ITextChangeListener,
                     public ZKVideoView::IVideoPlayerMessageListener
{
public:
    modeSetActivity();
    virtual ~modeSetActivity();

    /**
     * 注册定时器
     */
	void registerUserTimer(int id, int time);
	/**
	 * 取消定时器
	 */
	void unregisterUserTimer(int id);
	/**
	 * 重置定时器
	 */
	void resetUserTimer(int id, int time);

protected:
    /*TAG:PROTECTED_FUNCTION*/
    virtual const char* getAppName() const;
    virtual void onCreate();
    virtual void onClick(ZKBase *pBase);
    virtual void onResume();
    virtual void onPause();
    virtual void onIntent(const Intent *intentPtr);
    virtual bool onTimer(int id);

    virtual void onProgressChanged(ZKSeekBar *pSeekBar, int progress);

    virtual int getListItemCount(const ZKListView *pListView) const;
    virtual void obtainListItemData(ZKListView *pListView, ZKListView::ZKListItem *pListItem, int index);
    virtual void onItemClick(ZKListView *pListView, int index, int subItemIndex);

    virtual void onSlideItemClick(ZKSlideWindow *pSlideWindow, int index);

    virtual bool onTouchEvent(const MotionEvent &ev);

    virtual void onTextChanged(ZKTextView *pTextView, const string &text);

    void rigesterActivityTimer();

    virtual void onVideoPlayerMessage(ZKVideoView *pVideoView, int msg);
    void videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex);
    void startVideoLoopPlayback();
    void stopVideoLoopPlayback();
    bool parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList);
    int removeCharFromString(string& nString, char c);


private:
    /*TAG:PRIVATE_VARIABLE*/
    int mVideoLoopIndex;
    int mVideoLoopErrorCount;

};

#endif